package com.dz.lm.dao.business.read;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.dz.lm.common.dto.ApplyProductDTO;
import com.dz.lm.common.exception.DaoException;
import com.dz.lm.common.utils.stereotype.ReaderRepository;

@ReaderRepository("readApplyProductDao")
public interface ApplyProductDao {
	
    List<ApplyProductDTO>ListApplyProduct() throws DaoException;
	
    ApplyProductDTO selectByPrimaryKey(@Param("applyId") Integer applyId) throws DaoException;

    Map<String, Object> qryApplyInfo(Map<String, Object> param) throws DaoException;
    /**
     * 获取我的申请记录列表
     */
    List<Map<String, Object>> qryMyApplyList(Map<String, Object> qryParam) throws DaoException;
    /**
     * 获取我的申请记录总数
     */
    Integer qryMyApplyListCount(Map<String, Object> qryParam) throws DaoException;
    /**
     * 根据productId与applyUserId查找当前产品的createUserId
     */
    Integer qryProductDeployUser(Map<String, Object> qryParam) throws DaoException;
    /**
     * 根据agentProductId与applyUserId查找当前产品的createUserId
     */
    Map<String, Object> qryAgentProductDeployUser(Map<String, Object> qryParam) throws DaoException;
    /**
     * 根据applyUserId与productId或agentProductId查找当前产品申请信息
     */
    List<Map<String, Object>> qryApplyProductInfo(Map<String, Object> qryParam) throws DaoException;
    /**
     * 获取产品的支付金额与支付比率
     */
    Map<String, Object> qryAgentProductPayByApplyId(Map<String, Object> qryParam) throws DaoException;
    /**
     * 查询产品创建人或产品代理人信息
     */
    Map<String, Object> qryAgentOrCreateUserInfoByProductId(Map<String, Object> qryParam) throws DaoException;
    /**
     * 查询某产品未完成申请单数
     */
    Integer qryUnfinishedApplyCount(Map<String, Object> qryParam) throws DaoException;
    /**
     * 根据applyUserId与productId或agentProductId查找当前产品最新申请记录
     */
    Map<String, Object> qryLatestApplyInfo(Map<String, Object> qryParam) throws DaoException;
}
